-- GENERATED SPELL FOR [Phoenix] --


function spell0_21362(pUnit, Event) --@Ember Blast,Self--
pUnit:FullCastSpellOnTarget(34341,pUnit)
pUnit:RegisterEvent('Sorts_21362', 568, 1)
end

function spell1_21362(pUnit, Event) --@Rebirth,Self--
pUnit:FullCastSpellOnTarget(35369,pUnit)
pUnit:RegisterEvent('Sorts_21362', 2000, 1)
end

function spell2_21362(pUnit, Event) --@Rebirth,Self--
pUnit:FullCastSpellOnTarget(41587,pUnit)
pUnit:RegisterEvent('Sorts_21362', 2000, 1)
end

function spell3_21362(pUnit, Event) --@Summon Player,n/a--
pUnit:FullCastSpellOnTarget(20477,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21362', 556, 1)
end

function Sorts_21362(pUnit, Event)
local choix_sorts_21362 = math.random(0, 3)
if choix_sorts_21362 == 0 then
pUnit:RegisterEvent('spell0_21362', 1, 1)
end
if choix_sorts_21362 == 1 then
pUnit:RegisterEvent('spell1_21362', 1, 1)
end
if choix_sorts_21362 == 2 then
pUnit:RegisterEvent('spell2_21362', 1, 1)
end
if choix_sorts_21362 == 3 then
pUnit:RegisterEvent('spell3_21362', 1, 1)
end
end

function mob21362_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21362', math.random(1500, 3000), 1)
end

function mob21362_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21362_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21362_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21362, 1, 'mob21362_Action')
RegisterUnitEvent(21362, 2, 'mob21362_Leave')
RegisterUnitEvent(21362, 3, 'mob21362_Kill')
RegisterUnitEvent(21362, 4, 'mob21362_Die')
